<!--
  User: Kuttubek Aidaraliev
  Date: 06.04.2010
  Time: 15:51:24
-->
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:rich="http://richfaces.org/rich"
    xmlns:a4j="http://richfaces.org/a4j"
    template="../../WEB-INF/jspx/common/template.xhtml">

    <ui:define name="head">
        <title>
            <h:outputText value="#{messages.applicantList}" />
        </title>
    </ui:define>
  <ui:define name="body">
     <h3 align="center"><h:outputText value="#{messages.applicantList}" /></h3>
         <h:form>
            <h:commandButton value="#{messages.create}" action="#{applicantBeanController.preInsert}"/>
         </h:form>
         <rich:spacer height="10" width="100%" />
         <!--<rich:datascroller for="applicantListBeanId" align="left" rendered="#{not empty applicantBeanController.applicantDataModel}"/> -->
         <rich:dataTable value="#{applicantBeanController.realList}"
                         var="applicant"
                         width="100%"
                         rowKeyVar="row"
                         id="applicantListBeanId">

             <rich:column>
                <f:facet name="header">
                    <h:outputText value="#{messages.id}" />
                </f:facet>
                <h:outputText value="#{applicant.id}" />
             </rich:column>

             <rich:column>
                <f:facet name="header">
                    <h:outputText value="#{messages.title}"/>
                </f:facet>
                <h:outputText value="#{applicant.title}" />
             </rich:column>

             <rich:column>
                <f:facet name="header">
                    <h:outputText value="#{messages.operation}"/>
                </f:facet>
                <h:form>
                   <h:commandLink action="#{applicantBeanController.preUpdate}">
                        <h:outputText value="#{messages.edit}" />
                        <f:setPropertyActionListener value="#{applicant}" target="#{applicantBean.entity}"/>
                    </h:commandLink>
                </h:form>
                <rich:spacer height="10" width="20"/>
                <a4j:region>
                    <a4j:form>
                        <a4j:htmlCommandLink id="delete" action="#{applicantBeanController.deleted}">
                           <h:outputText value="#{messages.delete}"/>
                           <f:setPropertyActionListener value="#{applicant}"
                                                target="#{applicantBean.entity}" />
                        </a4j:htmlCommandLink>
                   </a4j:form>
                </a4j:region>
             </rich:column>

             <!--<rich:column>
                <f:facet name="header">
                    <h:outputText value="#{messages.delete}"/>
                </f:facet>
                 <a4j:commandButton value="#{messages.delete}" action="#{applicantBeanController.deleted}" reRender="table">
                    <f:setPropertyActionListener value="#{applicant}"
                                                 target="#{applicantBeanController.applicant}" />
                </a4j:commandButton>

             </rich:column>-->

             <!--<f:facet name="footer">
                  <rich:datascroller for="applicantListBeanId" align="left" rendered="#{not empty applicantBeanController.applicantDataModel}"/>
             </f:facet>-->

         </rich:dataTable>
  </ui:define>
</ui:composition>